Data stored in a database may be accessed in a manner that gives rise to temporal locality and/or spatial locality. Temporal locality may refer to the tendency for the same data to be accessed repeatedly over a short period of time. Meanwhile, spatial locality may refer to the tendency to access, within a short period of time, data from adjacent storage locations within the database. The caching of data may exploit both temporal locality and spatial locality. For example, a portion of the data in the database may be stored in a cache (e.g., an in-memory database and/or the like) in order to expedite subsequent requests for the same data. The data stored in the cache may include recently accessed data and/or data from adjacent storage locations.